﻿namespace Lzhdim.WinSrvMgr.Forms
{
    using Lzhdim.Animation.UI;
    using System;
    using System.Drawing;
    using System.Windows.Forms;

    /// <summary>
    /// 使用帮助窗体
    /// </summary>
    internal partial class WndUseHelp : FormBase
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        internal WndUseHelp()
        {
            InitializeComponent();

            this.Size = this.MaximumSize = this.MinimumSize = new Size(this.PanelBackground.Width, this.PanelBackground.Height);
        }

        /// <summary>
        /// 移动条鼠标按下事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lblMoveBar_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                MouseDownEffect(this);
            }
        }

        /// <summary>
        /// 移动条鼠标弹起事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lblMoveBar_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                ShowSystemMenu(e.Button);
            }
        }

        /// <summary>
        /// 关闭窗体菜单事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TSMClose_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                this.Close();
            }
        }

        /// <summary>
        /// 窗体关闭后事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WndUseHelp_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        /// <summary>
        /// 加载完成时事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WndUseHelp_Load(object sender, EventArgs e)
        {
            //读取资源里的UseHelp.txt文本显示，可在资源里双击该文件打开编辑
            this.lblUseHelp.Text = Properties.Resources.UseHelp;
        }
    }
}